import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Gao zhao xu
 * Date: 2023-10-09
 * Time: 21:43
 */
public class test1 {
    public static void main(String[] args) {
        System.out.println("1.=================================");
        MyStack stack = new MyStack();
        //压栈
        stack.push(12);
        stack.push(23);
        stack.push(34);
        stack.push(45);
        stack.show();
        System.out.println("2.=================================");
        //出栈
        System.out.println(stack.pop());
        stack.show();
        //由此可见先入后出
        System.out.println("3.=================================");
        //获取栈顶数据，但是不出栈
        System.out.println(stack.peek());
        stack.show();
        System.out.println("4.=================================");
        //获取栈数据个数
        System.out.println(stack.size());
        System.out.println("5.=================================");
        //判断是否栈空
        System.out.println(stack.empty());
        System.out.println("6.=================================");
    }
}
